﻿Public Class frmXemDiem
    Private Ma As Long = 0
    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

    End Sub
    Public Sub New(ByVal ma As Long)

        ' This call is required by the designer.
        InitializeComponent()
        Me.Ma = ma
        ' Add any initialization after the InitializeComponent() call.

    End Sub
    Public Sub LoadAllData()
        Dim diem As DAODiem = New DAODiem
        Dim ds As DataTable = New DataTable
        ds = diem.LoadTable("SELECT Diem.HocKy, Diem.NamHoc, Diem.Diem15Phut, Diem.Diem1Tiet, Diem.DiemCuoiKy, MonHoc.TenMonHoc FROM Diem,MonHoc where Diem.MaHS=" + Ma.ToString() + " and Diem.MaMonHoc=MonHoc.MaMonHoc", Application.StartupPath + "\database\database.mdb")
        dtgvDiem.AutoGenerateColumns = False
        dtgvDiem.DataSource = ds
    End Sub
    Private Sub frmXemDiem_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Text = "Mã: " + Me.Ma.ToString()
        LoadAllData()
    End Sub
End Class